<template>
  <div class="comHeader">
    <!-- NavBar 导航栏组件 -->
    <van-nav-bar
      :title="$route.meta.title"
      :left-text=value
      :left-arrow=!!value
      @click-left="$router.back()"
    />
  </div>
</template>

<script>
const list = ['add', 'edit', 'addCollectData', 'login', 'register', 'score']
export default {
  name: 'comHeader',
  computed: {
    value: function () {
      if (list.indexOf(this.$route.name) !== -1) {
        return '返回'
      } else {
        return ''
      }
    },
  },
}
</script>

<style lang="less" scoped>
// /deep/.van-nav-bar__content{
//   background: #1989fa;
// }
</style>
